package com.project;

import com.project.servlet.ServletTest;
import org.apache.catalina.Context;
import org.apache.catalina.LifecycleException;
import org.apache.catalina.Wrapper;
import org.apache.catalina.startup.Tomcat;

public class MainSocket {
    public MainSocket(){
        Tomcat tomcat= new Tomcat();
        tomcat.setPort(8088);
        tomcat.getConnector();

        Context context = tomcat.addContext("",null);
        try {
        Wrapper w =Tomcat.addServlet(context,"MainSocket",new ServletTest());
        w.addMapping("/dd");
            tomcat.start();
        } catch (LifecycleException e) {
            e.printStackTrace();
        }
    }
    public static void main(String[] args) {
        new MainSocket();
    }
}
